import React from 'react';
import moment from 'moment';
import { Avatar } from 'antd';
import styles from './index.less';
import Ellipsis from '@/components/Ellipsis';

const TopicContent = ({ data: { content, createdAt, updatedAt, avatar, owner, href } }) => {
  return (
    <div className={styles.listContent}>
      <div className={styles.description}>
        <Ellipsis lines={2}>{content}</Ellipsis>
      </div>
      <div className={styles.extra}>
        发布人：
        <Avatar src={avatar} size="small" />
        <a href={href}>{owner}</a>
        <em>发布时间：{moment(createdAt).format('YYYY-MM-DD HH:mm')}</em>
        <em>修改时间：{moment(updatedAt).format('YYYY-MM-DD HH:mm')}</em>
      </div>
    </div>
  );
};

export default TopicContent;
